﻿using System.Collections.Generic;
using System.Linq;

namespace Tuxedo.Compile
{
	internal class ArrayCreation : Expression
	{
		public int Length { get; private set; }
		public bool LengthResolved { get; private set; }
		public Expression[] Items { get; private set; }
		public UnverifiedType Type { get; private set; }

		private Expression lengthExpression;

		public ArrayCreation(UnverifiedType type, Expression sizeExpression, IList<Expression> values)
		{
			this.Type = type;
			this.LengthResolved = false;
			this.lengthExpression = sizeExpression;
			this.Items = values == null ? null : values.ToArray();
		}
	}
}
